#pragma once

class CPMRITICAL_SECTION_Lock
{
public:
	CPMRITICAL_SECTION_Lock(CRITICAL_SECTION * pSecion)
	{
		m_pSecion = pSecion;

		if(m_pSecion)
			EnterCriticalSection(m_pSecion);
	}

	virtual ~CPMRITICAL_SECTION_Lock()
	{
		if(m_pSecion)
			LeaveCriticalSection(m_pSecion);
	}

protected:

	CRITICAL_SECTION * m_pSecion;
};


class CCallBakMessage_Base
{
public:
	CCallBakMessage_Base() : m_pVoidPtr(NULL),m_iValue(0)
	{

	}
	virtual ~CCallBakMessage_Base()
	{

	}

	void SetIValue(int iValue)
	{
		m_iValue = iValue;
	}
	int GetIValue()
	{
		return m_iValue;
	}

	void SetSValue(CString strValue)
	{
		m_strValue = strValue;
	}
	CString GetSValue()
	{
		return m_strValue;
	}

	void SetVoidPtr(LPVOID pVoidPtr)
	{
		m_pVoidPtr = pVoidPtr;
	}
	LPVOID GetVoidPtr()
	{
		return m_pVoidPtr;
	}

protected:

	int				m_iValue;
	CString			m_strValue;
	LPVOID			m_pVoidPtr;
};

class CCommonFun
{
public:
	CCommonFun(void);
	virtual ~CCommonFun(void);

	static BOOL TracePlugin(DuiLib::CControlUI * pTraceInfo,int loopCount = 0);

	static BOOL TracePlugin_Child(DuiLib::CContainerUI * pTraceInfo,int loopCount);

//	static BOOL CCommonFun::PrintInfo(const CString & strErrorMsg,DWORD error);
};
